package com.ruoyi.teach.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.teach.mapper.SchClazzMapper;
import com.ruoyi.teach.domain.SchClazz;
import com.ruoyi.teach.service.ISchClazzService;

/**
 * 班级Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-12-08
 */
@Service
public class SchClazzServiceImpl implements ISchClazzService 
{
    @Autowired
    private SchClazzMapper schClazzMapper;

    /**
     * 查询班级
     * 
     * @param cId 班级主键
     * @return 班级
     */
    @Override
    public SchClazz selectSchClazzByCId(Long cId)
    {
        return schClazzMapper.selectSchClazzByCId(cId);
    }

    /**
     * 查询班级列表
     * 
     * @param schClazz 班级
     * @return 班级
     */
    @Override
    public List<SchClazz> selectSchClazzList(SchClazz schClazz)
    {
        return schClazzMapper.selectSchClazzList(schClazz);
    }

    /**
     * 新增班级
     * 
     * @param schClazz 班级
     * @return 结果
     */
    @Override
    public int insertSchClazz(SchClazz schClazz)
    {
        schClazz.setCreateTime(DateUtils.getNowDate());
        return schClazzMapper.insertSchClazz(schClazz);
    }

    /**
     * 修改班级
     * 
     * @param schClazz 班级
     * @return 结果
     */
    @Override
    public int updateSchClazz(SchClazz schClazz)
    {
        schClazz.setUpdateTime(DateUtils.getNowDate());
        return schClazzMapper.updateSchClazz(schClazz);
    }

    /**
     * 批量删除班级
     * 
     * @param cIds 需要删除的班级主键
     * @return 结果
     */
    @Override
    public int deleteSchClazzByCIds(Long[] cIds)
    {
        return schClazzMapper.deleteSchClazzByCIds(cIds);
    }

    /**
     * 删除班级信息
     * 
     * @param cId 班级主键
     * @return 结果
     */
    @Override
    public int deleteSchClazzByCId(Long cId)
    {
        return schClazzMapper.deleteSchClazzByCId(cId);
    }
}
